package javaer.starter.base.domain.vo;

import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.io.Serializable;
import java.util.Objects;

/**
 * 依赖拓展
 *
 * @author yangzhen
 * @date 2023/6/5 10:56
 * @since 1.0.0
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class DependencyIncludedVO implements Serializable {

    /**
     * 脚手架类型唯一标识
     */
    String typeId;
    /**
     * 依赖唯一标识
     */
    String depId;
    /**
     * 依赖坐标组
     */
    String groupId;
    /**
     * 依赖坐标
     */
    String artifactId;
    /**
     * 依赖版本
     */
    String version;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DependencyIncludedVO that = (DependencyIncludedVO) o;
        return Objects.equals(groupId, that.groupId) && Objects.equals(artifactId, that.artifactId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(groupId, artifactId);
    }
}